<?php
/**
 * 易优CMS
 * ============================================================================
 * 版权所有 2016-2028 海南赞赞网络科技有限公司，并保留所有权利。
 * 网站地址: http://www.eyoucms.com
 * ----------------------------------------------------------------------------
 * 如果商业用途务必到官方购买正版授权, 以免引起不必要的法律纠纷.
 * ============================================================================
 * Author: 小虎哥 <1105415366@qq.com>
 * Date: 2018-4-3
 */

/*基本信息*/
$ctlactArr = [
    'Shop@conf',
    'System@web',
    'System@web2',
    'System@basic',
    'System@water',
    'System@api_conf',
    'PayApi@pay_api_index',
];
$system_index_arr = array();
foreach ($ctlactArr as $key => $val) {
    if (is_check_access($val)) {
        $arr = explode('@', $val);
        $system_index_arr = array(
            'controller' => !empty($arr[0]) ? $arr[0] : '',
            'action'     => !empty($arr[1]) ? $arr[1] : '',
        );
        break;
    }
}
/*--end*/

/**
 * 权限模块属性说明
 * array
 *      id  主键ID
 *      parent_id   父ID
 *      name    模块名称
 *      controller  控制器
 *      action  操作名
 *      url     跳转链接(控制器与操作名为空时，才使用url)
 *      target  打开窗口方式
 *      icon    菜单图标
 *      grade   层级
 *      is_menu 是否显示菜单
 *      is_modules  是否显示权限模块分组
 *      is_subshowmenu  子模块是否有显示的模块
 *      child   子模块
 */
return  array(
    '1000'=>array(
        'id'=>1000,
        'parent_id'=>0,
        'name'=>'概况',
        'controller'=>'',
        'action'=>'',
        'param' => '',
        'url'=>'',
        'target'=>'workspace',
        'grade'=>0,
        'is_menu'=>1,
        'is_modules'=>1,
        'is_subshowmenu'=>1,
        'child'=>array(
            '1001' => [
                'id'=>1001,
                'parent_id'=>1000,
                'name' => '概况',
                'controller'=>'Index',
                'action'=>'welcome',
                'param' => '',
                'url'=>'',
                'target'=>'workspace',
                'icon'=>'iconfont e-gaikuang',
                'grade'=>1,
                'is_menu'=>1,
                'is_modules'=>1,
                'is_subshowmenu'=>0,
                'child' => [],
            ],
        ),
    ),
        
    '2000'=>array(
        'id'=>2000,
        'parent_id'=>0,
        'name'=>'商城',
        'controller'=>'',
        'action'=>'',
        'param' => '',
        'url'=>'', 
        'target'=>'workspace',
        'grade'=>0,
        'is_menu'=>1,
        'is_modules'=>1,
        'is_subshowmenu'=>1,
        'child'=>array(
            '2001' => array(
                'id'=>2001,
                'parent_id'=>2000,
                'name' => '店铺',
                'controller'=>'Store',
                'action'=>'weixin_conf',
                'param' => '|firstrun|1',
                'url'=>'', 
                'target'=>'workspace',
                'icon'=>'iconfont e-lanmuguanli',
                'grade'=>1,
                'is_menu'=>1,
                'is_modules'=>1,
                'is_subshowmenu'=>0,
                'child' => [
                    '2001001' => [
                        'id'=>2001001,
                        'parent_id'=>2001,
                        'name' => '微信小程序',
                        'controller'=>'Store',
                        'action'=>'weixin_conf',
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'fa fa-undo',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => [],
                    ],
                    '2001002' => [
                        'id'=>2001002,
                        'parent_id'=>2001,
                        'name' => 'H5',
                        'controller'=>'Store',
                        'action'=>'h5_conf',
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'fa fa-undo',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => [],
                    ],
                    '2001003' => [
                        'id'=>2001003,
                        'parent_id'=>2001,
                        'name' => 'PC端',
                        'controller'=>'Store',
                        'action'=>'pc_conf',
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'fa fa-undo',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => [],
                    ],
                ],
            ),
            '2002' => array(
                'id'=>2002,
                'parent_id'=>2000,
                'name' => '商品',
                'controller'=>'ShopProduct',
                'action'=>'index',
                'param' => '|query|1|firstrun|1',
                'url'=>'',
                'target'=>'workspace',
                'icon'=>'iconfont e-shangpinguanli',
                'grade'=>1,
                'is_menu'=>1,
                'is_modules'=>1,
                'is_subshowmenu'=>0,
                'child' => [
                    '2002001' => [
                        'id'=>2002001,
                        'parent_id'=>2002,
                        'name' => '商品列表',
                        'controller'=>'ShopProduct',
                        'action'=>'index',
                        'param' => '|query|1',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'fa fa-undo',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => [],
                    ],
                    '2002002' => [
                        'id'=>2002002,
                        'parent_id'=>2002,
                        'name' => '分类管理',
                        'controller'=>'ShopProduct',
                        'action'=>'arctype_index',
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'fa fa-undo',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => [],
                    ],
                    '2002003' => [
                        'id'=>2002003,
                        'parent_id'=>2002,
                        'name' => '商品参数',
                        'controller'=>'ShopProduct',
                        'action'=>'attrlist_index',
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'fa fa-undo',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => [],
                    ],
                    '2002004' => [
                        'id'=>2002004,
                        'parent_id'=>2002,
                        'name' => '营销标签',
                        'controller'=>'ShopProduct',
                        'action'=>'label_types',
                        'param' => '|types_value|1',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'fa fa-undo',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => [],
                    ],
                    '2002005' => [
                        'id'=>2002005,
                        'parent_id'=>2002,
                        'name' => '商品服务',
                        'controller'=>'ShopProduct',
                        'action'=>'label_types',
                        'param' => '|types_value|2',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'fa fa-undo',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => [],
                    ],
                ],
            ),
            '2003' => array(
                'id'=>2003,
                'parent_id'=>2000,
                'name' => '订单',
                'controller'=>'Order',
                'action'=>'index',
                'param' => '|firstrun|1',
                'url'=>'',
                'target'=>'workspace',
                'icon'=>'iconfont e-dingdanguanli',
                'grade'=>1,
                'is_menu'=> 1,
                'is_modules'=> 1,
                'is_subshowmenu'=>0,
                'child' => [
                    '2003001' => [
                        'id'=>2003001,
                        'parent_id'=>2003,
                        'name' => '商品订单',
                        'controller'=>'Shop',
                        'action'=>'index',
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'fa fa-undo',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => [],
                    ],
                    '2003002' => [
                        'id'=>2003002,
                        'parent_id'=>2003,
                        'name' => '充值订单',
                        'controller'=>'UsersMoney',
                        'action'=>'money_index',
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'fa fa-undo',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => [],
                    ],
                    '2003003' => [
                        'id'=>2003003,
                        'parent_id'=>2003,
                        'name' => '维权订单',
                        'controller'=>'ShopService',
                        'action'=>'after_service',
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'fa fa-undo',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => [],
                    ],
                    '2003004' => [
                        'id'=>2003004,
                        'parent_id'=>2003,
                        'name' => '订单评价',
                        'controller'=>'ShopComment',
                        'action'=>'comment_index',
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'fa fa-undo',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => [],
                    ],
                ],
            ),
            '2004' => array(
                'id'=>2004,
                'parent_id'=>2000,
                'name' => '会员',
                'controller'=>'Member',
                'action'=>'users_index',
                'param' => '|firstrun|1',
                'url'=>'',
                'target'=>'workspace',
                'icon'=>'iconfont e-gerenzhongxin',
                'grade'=>1,
                'is_menu'=>1,
                'is_modules'=>1,
                'is_subshowmenu'=>0,
                'child' => array(
                    '2004001' => array(
                        'id'=>2004001,
                        'parent_id'=>2004,
                        'name' => '会员列表',
                        'controller'=>'Member',
                        'action'=>'users_index',
                        'param' => '',
                        'url'=>'',
                        'target'=>'workspace',
                        'icon'=>'iconfont e-gerenzhongxin',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2004002' => array(
                        'id'=>2004002,
                        'parent_id'=>2004,
                        'name' => '会员等级',
                        'controller'=>'Level',
                        'action'=>'level_index',
                        'param' => '',
                        'url'=>'',
                        'target'=>'workspace',
                        'icon'=>'iconfont e-shipindingdan',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2004003' => array(
                        'id'=>2004003,
                        'parent_id'=>2004,
                        'name' => '充值活动',
                        'controller'=>'UsersMoneyRechargeType',
                        'action'=>'index',
                        'param' => '',
                        'url'=>'',
                        'target'=>'workspace',
                        'icon'=>'iconfont e-huiyuandingdan',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2004004' => array(
                        'id'=>2004004,
                        'parent_id'=>2004,
                        'name' => '余额明细',
                        'controller'=>'UsersMoney',
                        'action'=>'eyou_money_recharge_index',
                        'param' => '|cause_type|-1',
                        'url'=>'',
                        'target'=>'workspace',
                        'icon'=>'iconfont e-wenzhangdingdan',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2004005' => array(
                        'id'=>2004005,
                        'parent_id'=>2004,
                        'name' => '积分设置',
                        'controller'=>'UsersScore',
                        'action'=>'conf',
                        'param' => '',
                        'url'=>'',
                        'target'=>'workspace',
                        'icon'=>'iconfont e-wenzhangdingdan',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2004006' => array(
                        'id'=>2004006,
                        'parent_id'=>2004,
                        'name' => '积分明细',
                        'controller'=>'UsersScore',
                        'action'=>'index',
                        'param' => '',
                        'url'=>'',
                        'target'=>'workspace',
                        'icon'=>'iconfont e-wenzhangdingdan',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                ),
            ),
            '2005' => array(
                'id'=>2005,
                'parent_id'=>2000,
                'name' => '统计',
                'controller'=>'Statistics',
                'action'=>'index',
                'param' => '',
                'url'=>'',
                'target'=>'workspace',
                'icon'=>'iconfont e-chajian',
                'grade'=>1,
                'is_menu'=>1,
                'is_modules'=>1,
                'is_subshowmenu'=>0,
                'child'=>[
                    '2005001' => array(
                        'id'=>2005001,
                        'parent_id'=>2005,
                        'name' => '交易数据',
                        'controller'=>'Statistics',
                        'action'=>'index',
                        'param' => '',
                        'url'=>'',
                        'target'=>'workspace',
                        'icon'=>'iconfont e-wenzhangdingdan',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2005002' => array(
                        'id'=>2005002,
                        'parent_id'=>2005,
                        'name' => '会员数据',
                        'controller'=>'Statistics',
                        'action'=>'users_index',
                        'param' => '',
                        'url'=>'',
                        'target'=>'workspace',
                        'icon'=>'iconfont e-wenzhangdingdan',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                ],
            ),
            '2006' => array(
                'id'=>2006,
                'parent_id'=>2000,
                'name' => '设置',
                'controller'=>isset($system_index_arr['controller']) ? $system_index_arr['controller'] : 'System',
                'action'=>isset($system_index_arr['action']) ? $system_index_arr['action'] : 'conf',
                'param' => '',
                'url'=>'', 
                'target'=>'workspace',
                'icon'=>'iconfont e-shezhi',
                'grade'=>1,
                'is_menu'=>1,
                'is_modules'=>1,
                'is_subshowmenu'=>0,
                'child' => array(
                    '2006001' => array(
                        'id'=>2006001,
                        'parent_id'=>2006,
                        'name' => '基础信息',
                        'controller'=>'Shop',
                        'action'=>'conf',
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'iconfont fa-undo',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2006002' => array(
                        'id'=>2006002,
                        'parent_id'=>2006,
                        'name' => '退货地址',
                        'controller'=>'Shop',
                        'action'=>'address_index',
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'fa fa-undo',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2006003' => array(
                        'id'=>2006003,
                        'parent_id'=>2006,
                        'name' => '支付接口',
                        'controller'=>'System',
                        'action'=>'api_conf',
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'fa fa-undo',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2006004' => array(
                        'id'=>2006004,
                        'parent_id'=>2006,
                        'name' => '员工管理',
                        'controller'=>'Admin',
                        'action'=>'index',
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'fa fa-undo',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2006005' => array(
                        'id'=>2006005,
                        'parent_id'=>2006,
                        'name' => '运费模板',
                        'controller'=>'ShopFreight',
                        'action'=>'index',
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'fa fa-undo',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2006006' => array(
                        'id'=>2006006,
                        'parent_id'=>2006,
                        'name' => '帮助列表',
                        'controller'=>'Help',
                        'action'=>'index',
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'fa fa-undo',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2006007' => array(
                        'id'=>2006007,
                        'parent_id'=>2006,
                        'name' => '帮助分类',
                        'controller'=>'Help',
                        'action'=>'arctype_index',
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'fa fa-undo',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                ),
            ),
            '2007' => array(
                'id'=>2007,
                'parent_id'=>2000,
                'name' => '应用',
                'controller'=>'Weapp',
                'action'=>'index',
                'param' => '',
                'url'=>'', 
                'target'=>'workspace',
                'icon'=>'iconfont e-caidangongneng',
                'grade'=>1,
                'is_menu'=>1,
                'is_modules'=>1,
                'is_subshowmenu'=>0,
                'child' => array(
                    '2007001' => array(
                        'id'=>2007001,
                        'parent_id'=>2007,
                        'name' => '云应用', 
                        'controller'=>'Weapp',
                        'action'=>'plugin', 
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'iconfont e-guanliyuan',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2007002' => array(
                        'id'=>2007002,
                        'parent_id'=>2007,
                        'name' => '优惠券', 
                        'controller'=>'Coupon',
                        'action'=>'index',
                        'param' => '',
                        'url'=>'',
                        'target'=>'workspace',
                        'icon'=>'iconfont e-beifenhuanyuan',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2007003' => array(
                        'id'=>2007003,
                        'parent_id'=>2007,
                        'name' => '积分商城', 
                        'controller'=>'Memgift',
                        'action'=>'gift_exchange_list', 
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'iconfont e-mobanguanli',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2007004' => array(
                        'id'=>2007004,
                        'parent_id'=>2007,
                        'name' => '整点秒杀', 
                        'controller'=>'Sharp',
                        'action'=>'index',
                        'param' => '',
                        'url'=>'',
                        'target'=>'workspace',
                        'icon'=>'iconfont e-lanmuziduan',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2007005' => array(
                        'id'=>2007005,
                        'parent_id'=>2007,
                        'name' => '消息通知', 
                        'controller'=>'UsersNotice',
                        'action'=>'buyer_notice',
                        'param' => '',
                        'url'=>'',
                        'target'=>'workspace',
                        'icon'=>'iconfont e-lanmuziduan',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2007006' => array(
                        'id'=>2007006,
                        'parent_id'=>2007,
                        'name' => '数据备份',
                        'controller'=>'Tools',
                        'action'=>'index',
                        'param' => '',
                        'url'=>'',
                        'target'=>'workspace',
                        'icon'=>'iconfont e-huishouzhan',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2007007' => array(
                        'id'=>2007007,
                        'parent_id'=>2007,
                        'name' => '物流公司',
                        'controller'=>'Shop',
                        'action'=>'order_express',
                        'param' => '|select|1',
                        'url'=>'',
                        'target'=>'workspace',
                        'icon'=>'iconfont e-pindaomoxing',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2007008' => array(
                        'id'=>2007008,
                        'parent_id'=>2007,
                        'name' => '验证码管理',
                        'controller'=>'Vertify',
                        'action'=>'index',
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'iconfont e-wendangshuxing',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2007009' => array(
                        'id'=>2007009,
                        'parent_id'=>2007,
                        'name' => 'SEO设置',
                        'controller'=>'Seo',
                        'action'=>'seo',
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'iconfont  e-shuiyinpeizhi',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                    '2007010' => array(
                        'id'=>2007010,
                        'parent_id'=>2007,
                        'name' => '友情链接',
                        'controller'=>'Links',
                        'action'=>'index',
                        'param' => '',
                        'url'=>'', 
                        'target'=>'workspace',
                        'icon'=>'iconfont e-suolvetupeizhi',
                        'grade'=>2,
                        'is_menu'=>0,
                        'is_modules'=>1,
                        'is_subshowmenu'=>0,
                        'child' => array(),
                    ),
                ),
            ),
        ),
    ),
);